﻿<UserControl
    x:Class="SinaDesktop.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d"
    xmlns:controls="clr-namespace:SilverlightChina.Controls;assembly=SilverlightChina.Controls"
    xmlns:local="clr-namespace:SinaDesktop.Controls"
    d:DesignWidth="640" d:DesignHeight="300">
    
    <UserControl.Resources>
        <Storyboard x:Name="showrectProgress">
            <!--<DoubleAnimation Storyboard.TargetName="rectProgress" Storyboard.TargetProperty="Margin" To="30" Duration="0:0:0.3"></DoubleAnimation>-->
            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rectProgress" Storyboard.TargetProperty="Margin" Duration="0:1:0" RepeatBehavior="Forever">
                <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.5">
                    <DiscreteObjectKeyFrame.Value>
                        <Thickness>80,0,0,0</Thickness>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
                <DiscreteObjectKeyFrame KeyTime="0:0:1.5">
                    <DiscreteObjectKeyFrame.Value>
                        <Thickness>160,0,0,0</Thickness>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
                <DiscreteObjectKeyFrame KeyTime="0:0:2.0">
                    <DiscreteObjectKeyFrame.Value>
                        <Thickness>240,0,0,0</Thickness>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
                <DiscreteObjectKeyFrame KeyTime="0:0:2.5">
                    <DiscreteObjectKeyFrame.Value>
                        <Thickness>320,0,0,0</Thickness>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
                <DiscreteObjectKeyFrame KeyTime="0:0:3.0">
                    <DiscreteObjectKeyFrame.Value>
                        <Thickness>400,0,0,0</Thickness>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
                <DiscreteObjectKeyFrame KeyTime="0:0:3.5">
                    <DiscreteObjectKeyFrame.Value>
                        <Thickness>480,0,0,0</Thickness>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
                <DiscreteObjectKeyFrame KeyTime="0:0:4.5">
                    <DiscreteObjectKeyFrame.Value>
                        <Thickness>560,0,0,0</Thickness>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
                <DiscreteObjectKeyFrame KeyTime="0:0:5.5">
                    <DiscreteObjectKeyFrame.Value>
                        <Thickness>640,0,0,0</Thickness>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
                <DiscreteObjectKeyFrame KeyTime="0:0:6.5">
                    <DiscreteObjectKeyFrame.Value>
                        <Thickness>720,0,0,0</Thickness>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
                <DiscreteObjectKeyFrame KeyTime="0:0:7.5">
                    <DiscreteObjectKeyFrame.Value>
                        <Thickness>800,0,0,0</Thickness>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
                <DiscreteObjectKeyFrame KeyTime="0:0:8.5">
                    <DiscreteObjectKeyFrame.Value>
                        <Thickness>900,0,0,0</Thickness>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
                <DiscreteObjectKeyFrame KeyTime="0:0:9.5">
                    <DiscreteObjectKeyFrame.Value>
                        <Thickness>1024,0,0,0</Thickness>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames >
        </Storyboard>
    </UserControl.Resources>
    
    <Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}" Background="Transparent" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1"/>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="1"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="2"/>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1" />
        </Grid.RowDefinitions>

        <!-- Borders -->

        
        
        <Rectangle Tag="Top" Fill="{StaticResource HighlightBrush}"   Grid.ColumnSpan="4" Cursor="SizeNS" MouseLeftButtonDown="border_MouseLeftButtonDown">
            <Rectangle.Effect>
                <DropShadowEffect BlurRadius="20"
                              Opacity=".2"
                              Direction="300" />
            </Rectangle.Effect>
        </Rectangle>
        <Rectangle x:Name="rectProgress" Tag="TopProgress" Visibility="Collapsed" Height="3" Opacity=".8" Width="80" Fill="White" Grid.Column="0" />

        <Rectangle Tag="Bottom" Fill="{StaticResource HighlightBrush}"  Grid.ColumnSpan="4" Grid.Row="4" Cursor="SizeNS" MouseLeftButtonDown="border_MouseLeftButtonDown">
            <Rectangle.Effect>
                <DropShadowEffect BlurRadius="15"
                              Opacity=".8"
                              Direction="300" />
            </Rectangle.Effect>
        </Rectangle>
        <Rectangle Tag="Left" Fill="{StaticResource HighlightBrush}"  Grid.RowSpan="4" Cursor="SizeWE" MouseLeftButtonDown="border_MouseLeftButtonDown">
            <Rectangle.Effect>
                <DropShadowEffect BlurRadius="10"
                              Opacity=".5"
                              Direction="100" />
            </Rectangle.Effect>
        </Rectangle>
        <Rectangle Tag="Right" Fill="{StaticResource HighlightBrush}" Grid.RowSpan="4" Grid.Column="4" Cursor="SizeWE" MouseLeftButtonDown="border_MouseLeftButtonDown">
            <Rectangle.Effect>
                <DropShadowEffect BlurRadius="10"
                              Opacity=".8"
                              Direction="300" />
            </Rectangle.Effect>
        </Rectangle>

        <Rectangle Tag="TopLeft" Fill="{StaticResource HighlightBrush}" Cursor="SizeNWSE" MouseLeftButtonDown="border_MouseLeftButtonDown"></Rectangle>
        <Rectangle Tag="TopRight" Fill="{StaticResource HighlightBrush}" Grid.Column="3" Cursor="SizeNESW" MouseLeftButtonDown="border_MouseLeftButtonDown"></Rectangle>
        <Rectangle Tag="BottomLeft" Fill="{StaticResource HighlightBrush}" Grid.Row="4" Cursor="SizeNESW" MouseLeftButtonDown="border_MouseLeftButtonDown"></Rectangle>
        
        <!--Content-->
        <StackPanel x:Name="spHeader" Grid.Row="1" Grid.Column="1" Orientation="Horizontal" MouseLeftButtonDown="StackPanel_MouseLeftButtonDown" IsHitTestVisible="True" Background="Transparent" >
            <HyperlinkButton x:Name="hbGlobleSetting" IsTabStop="False" Click="hbGlobleSetting_Click" Opacity="1" Style="{StaticResource WindowsControlHyperlinkButtonStyle}" MouseEnter="hbGlobleSetting_MouseEnter" MouseLeave="hbGlobleSetting_MouseLeave">
              <StackPanel Background="{StaticResource HighlightBrush}" Orientation="Horizontal">
                    <TextBlock Text="LIGHT BUS" FontSize="12"  Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,3,1,3" FontFamily="Segoe UI, Lucida Sans Unicode, Verdana"/>
                <Image Source="/SinaDesktop;component/Images/Setting.png" Margin="3" Width="12"/>
              </StackPanel>
            </HyperlinkButton>
        </StackPanel>

        <local:WindowControl x:Name="winControl" HorizontalAlignment="Right" VerticalAlignment="Top" Grid.Row="1" Grid.Column="2"/>

        <navigation:Frame x:Name="MainFrame" Grid.Row="2" Grid.Column="1"  Grid.ColumnSpan="2"  FontSize="14" Source="/Login" Margin="0" UriMapper="{StaticResource mapper}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/>

        <local:ResizeControl x:Name="resizeControl" Grid.Row="3" Grid.Column="2" Opacity=".8" Height="18" Width="18" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
    </Grid>
        
</UserControl>

